<%@page import="java.util.UUID"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp" %>
<%
    String uuid = UUID.randomUUID().toString();
    request.setAttribute("uuid", uuid);
%>
<div class="row">
	<div class="col-md-12">
		<div>
			<div class="box-header with-border">
				<h3 class="box-title">
				
				</h3>
				<div class="box-tools pull-right" id="${uuid}_columnsGridTb">
					<button class="btn btn-sm btn-primary selectBtn">
						<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> 确定
					</button>
				</div>
			</div>
			<div class="box-body">
				<table id="${uuid}_columnsGrid"></table>
			</div><!-- /.box-body -->
		</div>
	</div>
</div>
<script type="text/javascript">
$(function(){
	var uuid = '${uuid}';
	var columnsGrid=$("#" + uuid + "_columnsGrid").bootstrapTable({
		url:ctx + "/queryDefAction/loadColumns.do?id=${param.id}",
		columns: [
				   {field: '_id',checkbox:true},
                   {title: '表名', field: 'tableName', align: 'left', width: 80},
                   {title: '字段名', field: 'name', align: 'left', width: 120},
                   {title: '类型', field: 'columnType', align: 'left', width: 120},
                   {title: '注释', field: 'comment', align: 'left', width: 120}
               ],
        hight: $(window).height()*0.5
	});
	
	var _columnsGridTb=$("#" + uuid + "_columnsGridTb");
	_columnsGridTb.find(".selectBtn").click(function(){
		var data = columnsGrid.bootstrapTable("getSelections");
   	 	top.webUtils.topicPublish("cols.select.success", data);
	});
});
</script>